package com.hzy.fivepalace.common.type;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 申请售后-收货状态枚举
 */
public enum ApplyAfterSaleTakeTypeEnums {
    TYPE1(1, "已收到商品"),
    TYPE2(2, "未收到商品");
    private int type;

    private String name;


    ApplyAfterSaleTakeTypeEnums(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public static ApplyAfterSaleTakeTypeEnums getEnum(int type) {
        for (ApplyAfterSaleTakeTypeEnums typeEnums : ApplyAfterSaleTakeTypeEnums.values()) {
            if (type == typeEnums.getType()) {
                return typeEnums;
            }
        }
        return null;
    }

    public static List<Map> getList() {
        List<Map> list = new ArrayList<>();
        for (ApplyAfterSaleTypeEnums typeEnums : ApplyAfterSaleTypeEnums.values()) {
            Map map = new HashMap<>();
            map.put("type", typeEnums.getType());
            map.put("name", typeEnums.getName());
            list.add(map);
        }
        return list;
    }


    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

}
